package route

import (
	"chatgpt/controller/glm"
	"chatgpt/controller/middleware"
	"github.com/gin-gonic/gin"
)

func glmRouter(router *gin.Engine) {
	appr := router.Group("/glm", middleware.RawData())
	appr.Any("completion", glm.CompletionHandle)
	appr.Any("test-search-update", glm.HandleTestSearchUpdate)
	appr.Any("test-upload", glm.HandleUpload)

	apprl := router.Group("/glm/dataset", middleware.ApiKeyCheck())
	{
		apprl.Any("upload-file", glm.UploadDatasetFile) // 数据集文件上传
		apprl.Any("clear", glm.HandleClearDataset)      // 数据集文件上传
		apprl.Any("upload-list", glm.GetDatasetFileList)		// 数据集上传结果列表
		apprl.DELETE("dataset", glm.DelDatasetAndRes)	// 删除数据集和数据集记录
	}
}
